<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.global.js"></script>
</head>
<body>
    <div id = 'app'>

        <!--        两次调用缓存-->
        计算属性：{{reverseMessage}}

    </div>
<script>
    const app = Vue.createApp({
        data() {
            return {
                message: 'Hello World!',
            }
        },
        methods:{

        },
        computed:{
            reverseMessage:{
                get(){
                    return this.message.split(' ').reverse().join(' ');
                },
                set(value){
                    this.message = value;
                }
            }
        },
        watch:{

        },
        mounted(){

        }
    });
    let vm = app.mount('#app');

    setTimeout(()=>{
        //reverseMessage底层调用set方法，
        vm.reverseMessage = 'hi vue';
    },2000)

</script>
</body>
</html>